class CommonFn{
    static dealSuccessReq(res){
        console.log('------------------------------dealSuccessReq------------------------------');
        console.log(res);
        console.log('--------------------------------------------------------------------------');
        return {
            statusCode:200,
            message:'success',
            data:res
        };
    }

    static dealErrorReq(err){
        console.log('-------------------------------dealErrorReq-------------------------------');
        console.log(err);
        console.log('--------------------------------------------------------------------------');
        return {
            statusCode:500,
            message:'error',
            error:err||{}
        };
    }

    static dealNotFoundReq(info){
        console.log('------------------------------dealNotFoundReq------------------------------');
        console.log(info);
        console.log('--------------------------------------------------------------------------');
        return {
            statusCode:404,
            message:'not found',
            info:info||''
        };
    }

    static dealMissArgsReq(args,reminder){
        console.log('------------------------------dealMissArgsReq------------------------------');
        console.log(args,reminder);
        console.log('--------------------------------------------------------------------------');
        return {
            statusCode: 400,
            message: 'missing args',
            args: args || {},
            reminder:reminder||''
        };
    }

    static getHost(){
        return 'http://127.0.0.1:8089/';
    }
}

module.exports = CommonFn;